package com.superm.controller;

import com.superm.entity.Emp;
import com.superm.service.EmpService;
import com.superm.service.ShelfDetailsService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.Map;

/**
 * 申请单详情
 */
@Controller
@RequestMapping("/shelfDetails")
public class ShelfDetailsController {


    @Autowired
    private ShelfDetailsService shelfDetailsService;

    @Autowired
    private EmpService empService;


    /**
     * 跳转到订单详情页面
     * @return
     */
    @RequestMapping("/skipShelfDetails")
    public ModelAndView skipShelfDetails(@RequestParam("sapplicationCode") String sapplicationCode){
        ModelAndView mv = new ModelAndView("shelfDetails/shefDetailsList");

        mv.addObject("sapplicationCode",sapplicationCode);
        return mv;
    }


    /**
     * 查询订单详情信息
     * @return
     */
    @RequestMapping("/likeShelfDetails")
    @ResponseBody
    public Map<String,Object> likeShelfDetails(@RequestParam("sapplicationCode") String sapplicationCode,@RequestParam("page") Integer pageNo,@RequestParam("limit")Integer pageSize){
        Map<String,Object> map = shelfDetailsService.likeShelfService(sapplicationCode,pageNo,pageSize);
        return  map;
    }

}
